package com.wzdigit.wms.raw.mapper.initialize;

import com.wzdigit.framework.orm.mybatis.MyBatisRepository;
import com.wzdigit.wms.raw.client.request.initialize.report.ImportInvTempRequest;
import com.wzdigit.wms.raw.client.request.initialize.report.InitializeSearchRequest;
import com.wzdigit.wms.raw.client.response.initialize.report.ErpCodeResponse;
import com.wzdigit.wms.raw.client.response.initialize.report.InitializeAsnDtl;
import com.wzdigit.wms.raw.client.response.initialize.report.InitializeAsnHeader;
import com.wzdigit.wms.raw.client.response.initialize.report.InitializeSearchResponse;
import com.wzdigit.wms.raw.client.response.initialize.report.WhsQastatusResponse;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 库存初始化BS  Mapper
 * Created by zyf on 2021/8/19 14:42
 */
@MyBatisRepository
public interface InitializeReportMapper {
    List<InitializeSearchResponse> searchAll(@Param("dto") InitializeSearchRequest request);

    //通过erp仓库+工厂获取wms仓库【新增】
    List<WhsQastatusResponse> insertSearch(@Param("erpCode") String erpCode,@Param("factory") String factory);

    //更新账本数量
    void  updateBookQty(@Param("invInitTempId") BigDecimal invInitTempId,@Param("bookQty")  BigDecimal bookQty,
                        @Param("loginName") String loginName,@Param("modifyTime") Date modifyTime);

    //查询ERP仓库
    List<ErpCodeResponse> selectErpCode(@Param("erpCode") String erpCode);

    //查询映射表仓库ID
    List<String> selectMappingWhs(@Param("erpCode") String erpCode,@Param("factory") String factory,
                                   @Param("qaStatus") Integer qaStatus);

    //新增
    void insertInvTemp(@Param("dto") ImportInvTempRequest dto);

    //查询ASN主档
    List<InitializeAsnHeader> searchAsnHeader(@Param("invInitTempId") String  invInitTempId);

    //查询ASN明细
    List<InitializeAsnDtl> searchAsnDtl(@Param("asnHeaderId") BigDecimal  asnHeaderId);

}
